package com.iflytek.sbd.service.db.impl;

import com.github.pagehelper.page.PageMethod;
import com.iflytek.sbd.mapper.db.ComputerMapper;
import com.iflytek.sbd.mybatis.BaseServiceImpl;
import com.iflytek.sbd.mybatis.PageResultBean;
import com.iflytek.sbd.po.db.Computer;
import com.iflytek.sbd.service.db.ComputerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: sbd
 * @description:
 * @author: 陈亮
 * @create: 2022-02-27 21:38
 */
@Service
public class ComputerServiceImpl implements ComputerService {

    @Resource
    private ComputerMapper computerMapper;

    @Override
    public void saveComputer(Computer computer) {
        computerMapper.insert(computer);
    }


    @Override
    public PageResultBean<Computer> findList() {
        PageMethod.startPage(1,20);
        List<Computer> list=computerMapper.getAll();
        return new PageResultBean<>(list);
    }
}
